<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('member_money_logs', function (Blueprint $table) {
            $table->id();
            $table->bigInteger('member_id');
            $table->bigInteger('user_id')->comment('操作人id');
            $table->bigInteger('store_id')->nullable()->comment('门店id');
            $table->decimal('money')->comment('变动金额');
            $table->bigInteger('out_id')->nullable()->comment('事件外部表id');
            $table->string('content')->nullable()->comment('详情');
            $table->string('channel')->comment('充值时的支付渠道');
            $table->string('type');
            $table->decimal('give_money')->default(0)->comment('赠送金额');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('member_money_logs');
    }
};
